package com.yjd.pub.order.service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.order.model.OrderRefuseContentModel;
import com.yjd.comm.order.service.IOrderRefuseContentService;
import com.yjd.pub.order.dao.IOrderRefuseContentDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * <b>description</b>：订单拒绝原因表业务实现<br>
 * <b>time</b>：2017-08-28 17:15:57 <br>
 * <b>author</b>：  carl
 */
@Service("orderRefuseContentService")
public class OrderRefuseContentServiceImpl extends BaseServiceImpl implements IOrderRefuseContentService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public OrderRefuseContentModel insert(OrderRefuseContentModel model) throws Exception {
		return this.orderRefuseContentDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(OrderRefuseContentModel model) throws Exception {
		return this.orderRefuseContentDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param order_id
	 * @return
	 * @throws Exception
	 */
	public int delete(long order_id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("order_id", order_id);
		return this.orderRefuseContentDao.deleteModel(paramMap, true);
	}

	@Resource
	private IOrderRefuseContentDao orderRefuseContentDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.orderRefuseContentDao;
	}

}
